package com.yifeng.repo.base.api;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * Created by daibing on 2023/11/27.
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class DateTimeRange {
    private LocalDateTime start;
    private LocalDateTime end;

    public DateTimeRange(LocalDateTime time, int rangeMinutes, boolean reverse) {
        this.start = reverse ? time.minusMinutes(rangeMinutes) : time;
        this.end = reverse ? time : time.plusMinutes(rangeMinutes);
    }

}
